*************************************************
*			00_timelimits_clean					*
*												*
*	This do file runs code to clean EIA			* 
*	data and compile it for the analyses		*
*   in Ricks ® Kay "Time-Limited Subsidies"		*
*												*
*												*
*												*
*************************************************


* prepare 
clear all
set more off, perm
cap log close

* packages (uncommend if needed)
* cap net install dm88_1.pkg 
* cap ssc install gtools

***
* Set Macros Here
***

* set directory
global wind 	"/Users/michaeldavidricks/Documents/timelimits_replication"
cap mkdir "${wind}/temp"

* set last year of EIA data
global last_year = 2021


***
* Clean and Compile
***

* Clean EIA Generation Data 
do "${wind}/code/clean/01_eia923_netgen.do" 

* Clean EIA Capacitcy Data
do "${wind}/code/clean/02_eia860_capacity.do"

* Clean EIA Pricing Data
do "${wind}/code/clean/03_eia923_resale.do"

* Clean WindIQ Data
*		(uncomment this line if you have access to proprietary wind turbine data)
*do "${wind}/code/clean/04_windiq.do"

* Compile Analysis Dataset 
*		(uncomment this line if you have cleaned to proprietary wind turbine data)
*do "${wind}/code/clean/05_compile.do"
